import mapboxgl from 'mapbox-gl'
import { Scene } from '@antv/l7'
import { Mapbox } from '@antv/l7'

mapboxgl.accessToken =
  'pk.eyJ1IjoiemhvbmdkaXNodW1hIiwiYSI6ImNsNXJoYXR5eTI2bGgzZW53d2didWF1c3AifQ.6vOplM2NQc_xnJW3aA5ZBA'

export function createMapboxInstance(domID){
    return new mapboxgl.Map({
      container: domID,
      style: 'mapbox://styles/mapbox/dark-v11',
      center: [114.299, 30.585],
      zoom: 1,
      projection: 'globe',
      attributionControl: false,
    })
}

export function createScene(map){
    return new Scene({
      id: 'map',
      map: new Mapbox({
        mapInstance: map,
      }),
      logoVisible: false,
    })
}